


<style>
    .request_data_table input{width: 80px!important;padding-left: 10px;}
    .reward-tab{padding: 10px;height: 100%;width: 849px;margin-left: 69px;}
    .share-reward input{margin-top:20px;}
    .add-share,.add-team{cursor: pointer;background-color: rgb(0,166,90); display:inline-block;text-align: center;font-size: 20px; line-height: 22px;width: 22px}
    .reduce-share,.reduce-team{cursor: pointer;background-color:  rgb(221,75,57); display:inline-block;text-align: center;font-size: 20px; line-height: 22px;width: 22px}
</style>


<div class="x-body">
    <div class="layui-form form_single" id="form" action="{:url()}" method="post" layui-filter="test1">
        <div class="layui-form-item">
            <label for="start" class="layui-form-label">
                <span class="x-red">*</span>生成数据日期
            </label>
            <div class="layui-input-block">
                <input class="layui-input"  autocomplete="off" placeholder="开始日"  name="date1"  id="start">
            </div>

        </div>

        <div class="layui-form-item">
            <label for="statrt_address_time" class="layui-form-label">
                <span class="x-red">*</span>选用创建地址区间时间
            </label>
            <div class="layui-input-block">
                <input class="layui-input"  autocomplete="off" placeholder="开始日"  name="date2"  id="statrt_address_time">
            </div>

        </div>

        <div class="layui-form-item">
            <label for="end_address_time" class="layui-form-label">
                <span class="x-red">*</span>选用创建地址区间时间
            </label>
            <div class="layui-input-block">
                <input class="layui-input"  autocomplete="off" placeholder="结束日"  name="date3"   id="end_address_time">
            </div>

        </div>


        <table class="layui-table x-admin">
            <thead>
            <tr>

                <th>地址数量</th>
                <th>金额</th>
                <th>类型</th>
                <th>  <b class="add-share add-table" >+</b></a>&nbsp;&nbsp;  <b class="reduce-share reduce-table" >-</b></th>
            </tr>
            </thead>

            <tbody class="table-body" >

            <tr class="table-data">
                <td><input  name="address_count[]"></td>
                <td><input  name="amount[]" ></td>
                <td>
                    <select name="flag[]" >
                        <option value="1">输</option>
                        <option value="2">赢</option>
                    </select>

                </td>
                <td>  <b class="add-share add-tr" >+</b></a>&nbsp;&nbsp;  <b class="reduce-share reduce-tr" >-</b></td>
            </tr>

            </tbody>
        </table>














        <div class="box-footer">

            {include file="layout/edit_btn_group"/}

        </div>


    </div>
</div>

<script>

    layui.use('laydate', function(){
        var laydate = layui.laydate;

        //执行一个laydate实例
        laydate.render({
            elem: '#start' //指定元素
        });

        //执行一个laydate实例
        laydate.render({
            elem: '#end_address_time' //指定元素
        });

        //执行一个laydate实例
        laydate.render({
            elem: '#statrt_address_time' //指定元素
        });
    });


    $('.x-admin').on('click','.add-table',(function () {

        var html= '  <tr class="table-data"> <td><input type="text" name="address_count[]" ></td> <td><input type="number" name="amount[]" ></td><td><select name="flag[]" ><option value="1">输</option><option value="2">赢</option></select></td> <td>  <b class="add-share add-tr" >+</b></a>&nbsp;&nbsp;  <b class="reduce-share reduce-tr" >-</b></td> </tr>';

        $('.table-body').append(html);
        layui.use('form', function(){

            var form = layui.form;
            form.render('select');

        });
    }))

    $('.x-admin').on('click','.reduce-table',(function () {



        $('.table-data').last().remove();
        layui.use('form', function(){

            var form = layui.form;
            form.render('select');

        });

    }))

    $('.x-admin').on('click','.add-tr',(function () {

        var html= '  <tr class="table-data"> <td><input type="text" name="address_count[]" ></td> <td><input type="number" name="amount[]" ></td> <td><select name="flag[]"><option value="1">输</option><option value="2">赢</option></select></td> <td>  <b class="add-share add-tr" >+</b></a>&nbsp;&nbsp;  <b class="reduce-share reduce-tr" >-</b></td> </tr>';

        $(this).parent().parent().after(html);
        layui.use('form', function(){

            var form = layui.form;
            form.render('select');

        });


    }))
    $('.x-admin').on('click','.reduce-tr',(function () {



        $(this).parent().parent().remove();
        layui.use('form', function(){

            var form = layui.form;
            form.render('select');

        });
    }))


</script>
